		**********************************************************
		** File: Figure_C16.do									**
		** Paper: Human Trafficking Indicators: A New Dataset	**
		** Author: Richard Frank								**
		** Date: July 11, 2021									**
		** Task: Creating Figure C16							**
 		**********************************************************

			clear
			version 16.1
			set max_memory 32g, permanently
			set seed 1234
			set level 95 		
			
		cd "~"
	 use "/HTI 00-17.dta", clear
	  
	 drop if ccode<0
 
	 **DICHOTOMIZING **
	    
	 	 
		 ** protectprogress **
		gen pr_no_dich=.
		replace pr_no_dich=1 if protectprogress==-1
 
		gen pr_nm_dich=.
		replace pr_nm_dich=1 if protectprogress==0
		
		gen pr_yes_dich=.
		replace pr_yes_dich=1 if protectprogress==1
 		
 
	** Total number
		
		collapse (sum) pr_no_dich pr_nm_dich pr_yes_dich ///
			 , by(year)
		 
		  gen totcount=.
		  replace totcount=82 if year==2001
		  replace totcount=89 if year==2002
		  replace totcount=124 if year==2003
		  replace totcount=139 if year==2004
		  replace totcount=147 if year==2005
		  replace totcount=156 if year==2006 
		  replace totcount=161 if year==2007
		  replace totcount=165 if year==2008
		  replace totcount=172 if year==2009	  
		  replace totcount=173 if year==2010
		  replace totcount=179 if year==2011
		  replace totcount=182 if year==2012	  
		  replace totcount=182 if year==2013
		  replace totcount=178 if year==2014
		  replace totcount=178 if year==2015	  
		  replace totcount=177 if year==2016
		  replace totcount=179 if year==2017	 
 
	**PERCENTAGE **

		gen pr_no=pr_no_dich/totcount
		label var pr_no "No"
		gen pr_nm=pr_nm_dich/totcount
		label var pr_nm "No mention"
		gen pr_yes=pr_yes_dich/totcount
		label var pr_yes "Yes"	 
 

		twoway (line pr_yes year, sort) ///
				(line pr_no year , sort) ///
				(line pr_nm year , sort) /// 
				, /// 
		 ytitle(% of countries in sample) title(Protection progress)  legend(pos(6) cols(3)) xtitle("") xlabel(2001(2)2017)
		graph save pp.gph, replace

		
	 	
		 
	  
	  
	  
	  
	  
	  
	  
